#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <string.h>
#include <ctype.h>
void reverse(char* arr, int left, int right)
{
    while (left <= right)
    {
        char tmp = arr[left];
        arr[left] = arr[right];
        arr[right] = tmp;
        left++;
        right--;
    }
}

int main()
{
    char arr[10000] = { 0 };
    gets(arr);
    int len = strlen(arr);
    reverse(arr, 0, len - 1);
    char* parr = arr;
    int left = 0;
    int right = 0;
    while (*parr)
    {
        if (isalpha(*parr))
        {
            right++;
        }
        else
        {
            *parr = ' ';
            reverse(arr, left, right - 1);
            left = right+1;
        }
        parr++;
    }
    int i = 0;
    for (i = 0; i < len; i++)
    {
        printf("%c", arr[i]);
    }
    return 0;
}